package org.tgcloud.group.repository;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.tgcloud.group.entity.SysManagerUser;
import org.tgcloud.group.web.controller.dto.user.ManageUserDTO;
import org.tgcloud.group.web.controller.dto.user.ManagerAdminUserDTO;

import java.util.Date;
import java.util.List;

/**
 * @Author: zhy
 * @Created: 2024-07-09-下午1:06
 * @Description: ${description}
 */
@Mapper
public interface SysManagerUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SysManagerUser record);

    int insertSelective(SysManagerUser record);

    SysManagerUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysManagerUser record);

    int updateByPrimaryKey(SysManagerUser record);

    SysManagerUser selectByUsername(@Param("username") String username);

    int updateLastTimeById(@Param("id") Integer id);

    SysManagerUser selectMsgByUserId(@Param("userId") int userId);

    int countByRoleId(@Param("roleId") Integer roleId);

    int selectNeedDelNumByIds(@Param("ids") String[] split);

    SysManagerUser selectMsgById(@Param("userId") Integer userId);

    SysManagerUser selectAccountMsg(@Param("telephone") String telephone);

    int updateMsgById(@Param("userId") int userId, @Param("username") String username,
                      @Param("roleId") String roleId);

    int updateStatusById(@Param("ids") String[] ids, @Param("status") short status);

    List<ManagerAdminUserDTO> selectListByKeyword(@Param("keyword") String keyword, @Param("startTime") Date startTime,
                                                  @Param("endTime") Date endTime, @Param("roleId") String[] roleId, @Param("status") Short status);

    List<Integer> selectCountRoleIdByIds(@Param("ids") String[] ids);

    int updateAppUserIdByUserId(@Param("userId") Integer userId, @Param("appUserId") Integer appUserId);

    int updateRoleByUserId(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

    SysManagerUser selectMsgByBindUserId(@Param("userId") Integer id);

    List<ManageUserDTO> selectListByRoleIds(@Param("roleIdList") String[] split);

    List<String> selectUsernameByIds(@Param("ids") String[] split);

    List<ManageUserDTO> selectListByRoleId(@Param("roleId") Integer roleId);

    List<ManagerAdminUserDTO> selectChooseListByKeyword(@Param("roleIds") String[] roleIds);
}